package com.bw.zg3park2212.adpter

import android.widget.TextView
import com.bw.base.entity.GongEntity
import com.bw.base.entity.GongEntityItem
import com.bw.zg3park2212.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class GongAdpter:BaseQuickAdapter<GongEntityItem,BaseViewHolder>(R.layout.item_gong) {
    override fun convert(helper: BaseViewHolder, item: GongEntityItem) {
      helper.setText(R.id.gong_title,item.title)
      helper.setText(R.id.gong_time,item.publishTime)
      helper.setText(R.id.gong_cont,item.content)
        val gong_suate = helper.getView<TextView>(R.id.gong_suate)
        if (item.status=="未阅读"){
            gong_suate.setTextColor(context.resources.getColor(R.color.white))
            gong_suate.setBackgroundResource(R.drawable.bg_yidu)
            gong_suate.text="立即报名"
         }else{
            gong_suate.setTextColor(context.resources.getColor(R.color.color_zhanyong))
            gong_suate.setBackgroundResource(R.drawable.bg_zganyong)
            gong_suate.text="已读"
        }
    }
}